package com.ruoyi.web.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.business.service.UserBuyVipService;
import com.ruoyi.business.vo.UserBuyVipListVO;
import com.ruoyi.common.common.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @title: StatisticsController
 * @copyright: copyright (c) 2023
 * @author: jiangguanjun
 * @date: 2023/2/9 16:12
 * @firstReview:
 * @lastReview:
 * @desc:
 */
@Api(value = "UserBuyVipController", tags = "用户购买VIP相关操作")
@RestController
@Slf4j
@RequestMapping("/userBuyVip")
public class UserBuyVipController {
    @Autowired
    private UserBuyVipService userBuyVipService ;

    @CrossOrigin
    @GetMapping("/list")
    @ApiOperation(value = "VIP 购买列表，页面：VIP统计")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "startTime", value = "开始时间戳", required = false,dataType = "Long"),
            @ApiImplicitParam(name = "endTime", value = "结束时间戳" ,required = false, dataType = "Long")
    })
    public ResultBody<IPage<UserBuyVipListVO>> add(@RequestParam(value = "startTime",required = false) Long startTime,
                                                   @RequestParam(value = "endTime",required = false) Long endTime){
        log.info("传入参数：startTime：：{}，endTime：：：{}",startTime,endTime);

        return userBuyVipService.vipBuyList(startTime,endTime) ;
    }




}
